/**
 * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.purchaseorder.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.jeeplus.common.utils.excel.annotation.ExcelField;
import com.jeeplus.core.persistence.DataEntity;
import com.jeeplus.modules.member.entity.Member;
import com.jeeplus.modules.subgoods.entity.SubGoods;

import java.util.Date;

/**
 * 买入订单Entity
 * @author w
 * @version 2021-03-27
 */
public class TradeOrder extends DataEntity<TradeOrder> {

	private static final long serialVersionUID = 1L;
	private String orderNo;		// 订单编号
	private SubGoods subGoods;		// 买入商品
	private Member member;		// 用户
	private Double price;		// 价格
	private Integer num;		// 数量
	private String type;		//类型 0买入 1卖出
	private Date orderDate;

	public TradeOrder() {
		super();
	}

	public TradeOrder(String id){
		super(id);
	}

	@ExcelField(title="订单编号", align=2, sort=1)
	public String getOrderNo() {
		return orderNo;
	}

	public void setOrderNo(String orderNo) {
		this.orderNo = orderNo;
	}
	
	@ExcelField(title="买入商品", fieldType=SubGoods.class, value="subGoods.goodsName", align=2, sort=2)
	public SubGoods getSubGoods() {
		return subGoods;
	}

	public void setSubGoods(SubGoods subGoods) {
		this.subGoods = subGoods;
	}
	
	@ExcelField(title="买入用户", fieldType=Member.class, value="member.loginName", align=2, sort=3)
	public Member getMember() {
		return member;
	}

	public void setMember(Member member) {
		this.member = member;
	}
	
	@ExcelField(title="价格", align=2, sort=4)
	public Double getPrice() {
		return price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}
	
	@ExcelField(title="数量", align=2, sort=5)
	public Integer getNum() {
		return num;
	}

	public void setNum(Integer num) {
		this.num = num;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getOrderDate() {
		return orderDate;
	}

	public void setOrderDate(Date orderDate) {
		this.orderDate = orderDate;
	}
}